-- GENERATED SPELL FOR [Plague Ghoul] --


function spell0_10405(pUnit, Event) --@Cleave,n/a--
pUnit:FullCastSpellOnTarget(40505,pUnit:GetMainTank ())
pUnit:RegisterEvent('Sorts_10405', 599, 1)
end

function spell1_10405(pUnit, Event) --@Enrage,Self--
pUnit:FullCastSpellOnTarget(8599,pUnit)
pUnit:RegisterEvent('Sorts_10405', 641, 1)
end

function spell2_10405(pUnit, Event) --@Ghoul Plague,n/a--
pUnit:FullCastSpellOnTarget(16458,pUnit:GetMainTank ())
pUnit:RegisterEvent('Sorts_10405', 636, 1)
end

function Sorts_10405(pUnit, Event)
local choix_sorts_10405 = math.random(0, 2)
if choix_sorts_10405 == 0 then
pUnit:RegisterEvent('spell0_10405', 1, 1)
end
if choix_sorts_10405 == 1 then
pUnit:RegisterEvent('spell1_10405', 1, 1)
end
if choix_sorts_10405 == 2 then
pUnit:RegisterEvent('spell2_10405', 1, 1)
end
end

function mob10405_Action(pUnit, Event)
pUnit:RegisterEvent('Sorts_10405', math.random(1500, 3000), 1)
end

function mob10405_Leave(pUnit, Event)
--pUnit:RemoveEvents();--
end

function mob10405_Kill(pUnit, Event)
--pUnit:RemoveEvents();--
end

function mob10405_Die(pUnit, Event)
pUnit:RemoveEvents();
end

RegisterUnitEvent(10405, 1, 'mob10405_Action')
RegisterUnitEvent(10405, 2, 'mob10405_Leave')
RegisterUnitEvent(10405, 3, 'mob10405_Kill')
RegisterUnitEvent(10405, 4, 'mob10405_Die')
